package org.panda.spring;

import org.panda.spring.service.UserServer;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;

public class BeanFactoryTest {
    public static void main(String[] args) {
        //创建工厂对象
        DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
        //创建一个读取器（xml文件）
        XmlBeanDefinitionReader reader =  new XmlBeanDefinitionReader(beanFactory);
        reader.loadBeanDefinitions("beans.xml");
        UserServer userServer = (UserServer) beanFactory.getBean("userServer");
//        System.out.print(userServer);
    }
}
